import { Form, Checkbox, Select } from 'antd';
import Strategy from '../components/Strategy';

export default function Advance(props: any) {
    const { form } = props;
    const urgingRuleValue = Form.useWatch(['senior', 'urgingRule'], form);

    return (
        <>
            <Form.Item label="催办规则" name={['senior', 'urgingRule']} className='bpmn-custom-properties-radio-label no-padding'>
                <Checkbox.Group
                    options={[
                        {
                            label: '手动催办',
                            value: 'isUrge',
                        },
                        {
                            label: '自动催办',
                            value: 'automaticUrge',
                        },
                    ]}
                />
            </Form.Item>
            {
                urgingRuleValue?.includes('isUrge')
                &&
                <Form.Item label="手动催办间隔" name={['senior', 'urgingInterval']}>
                    <Select
                        options={[
                            {
                                value: 0.5,
                                label: '30分钟',
                            },
                            {
                                value: 1,
                                label: '1个小时',
                            },
                            {
                                value: 2,
                                label: '2个小时',
                            },
                            {
                                value: 24,
                                label: '24小时',
                            },
                            // {
                            //     value: '5',
                            //     label: '不限',
                            // },
                        ]}
                    />
                </Form.Item>
            }
            {
                urgingRuleValue?.includes('automaticUrge')
                &&
                <Form.Item label="自动催办策略" name={['senior', 'automaticIntervar']}>
                    <Strategy />
                </Form.Item>
            }
        </>
    );
};
